package com.yuedao.sender.model1;

import javax.persistence.*;

/**
 * AssistDemo
 * com.chris.demo.model.orm
 * Created by Chris Chen
 * 2018/1/5
 * Explain:
 */
@Entity(name = "ydx_pricing_codes_algorithms")
public class PriceCodeAlgorithmEntity {
    private int id;
    private String mapName;
    private Integer pricingCodeId;
    private Integer pricingAlgorithmId;
    private Integer orderTypeId;
    private Integer charterType;
    private Integer cityDistrictId;
    private Integer airportId;
    private String description;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "map_name", nullable = true, length = 1024)
    public String getMapName() {
        return mapName;
    }

    public void setMapName(String mapName) {
        this.mapName = mapName;
    }

    @Basic
    @Column(name = "pricing_code_id", nullable = true)
    public Integer getPricingCodeId() {
        return pricingCodeId;
    }

    public void setPricingCodeId(Integer pricingCodeId) {
        this.pricingCodeId = pricingCodeId;
    }

    @Basic
    @Column(name = "pricing_algorithm_id", nullable = true)
    public Integer getPricingAlgorithmId() {
        return pricingAlgorithmId;
    }

    public void setPricingAlgorithmId(Integer pricingAlgorithmId) {
        this.pricingAlgorithmId = pricingAlgorithmId;
    }

    @Basic
    @Column(name = "order_type_id", nullable = true)
    public Integer getOrderTypeId() {
        return orderTypeId;
    }

    public void setOrderTypeId(Integer orderTypeId) {
        this.orderTypeId = orderTypeId;
    }

    @Basic
    @Column(name = "charter_type", nullable = true)
    public Integer getCharterType() {
        return charterType;
    }

    public void setCharterType(Integer charterType) {
        this.charterType = charterType;
    }

    @Basic
    @Column(name = "city_district_id", nullable = true)
    public Integer getCityDistrictId() {
        return cityDistrictId;
    }

    public void setCityDistrictId(Integer cityDistrictId) {
        this.cityDistrictId = cityDistrictId;
    }

    @Basic
    @Column(name = "airport_id", nullable = true)
    public Integer getAirportId() {
        return airportId;
    }

    public void setAirportId(Integer airportId) {
        this.airportId = airportId;
    }

    @Basic
    @Column(name = "description", nullable = true, length = 2048)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PriceCodeAlgorithmEntity that = (PriceCodeAlgorithmEntity) o;

        if (id != that.id) return false;
        if (mapName != null ? !mapName.equals(that.mapName) : that.mapName != null) return false;
        if (pricingCodeId != null ? !pricingCodeId.equals(that.pricingCodeId) : that.pricingCodeId != null)
            return false;
        if (pricingAlgorithmId != null ? !pricingAlgorithmId.equals(that.pricingAlgorithmId) : that.pricingAlgorithmId != null)
            return false;
        if (orderTypeId != null ? !orderTypeId.equals(that.orderTypeId) : that.orderTypeId != null) return false;
        if (charterType != null ? !charterType.equals(that.charterType) : that.charterType != null) return false;
        if (cityDistrictId != null ? !cityDistrictId.equals(that.cityDistrictId) : that.cityDistrictId != null)
            return false;
        if (airportId != null ? !airportId.equals(that.airportId) : that.airportId != null) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (mapName != null ? mapName.hashCode() : 0);
        result = 31 * result + (pricingCodeId != null ? pricingCodeId.hashCode() : 0);
        result = 31 * result + (pricingAlgorithmId != null ? pricingAlgorithmId.hashCode() : 0);
        result = 31 * result + (orderTypeId != null ? orderTypeId.hashCode() : 0);
        result = 31 * result + (charterType != null ? charterType.hashCode() : 0);
        result = 31 * result + (cityDistrictId != null ? cityDistrictId.hashCode() : 0);
        result = 31 * result + (airportId != null ? airportId.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        return result;
    }
}
